﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.Entity.Infrastructure;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DevTest
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        Entities db=new Entities();//数据上下文对象
        private void Form1_Load(object sender, EventArgs e)
        {
            //此处返回一个IQueryable接口
            //IQueryable<Class122> query=db.Class122.Where(d=>d.成绩>50);
            //EnumerableQuery<Class122> query = (db.Class122.Where(d => d.成绩 > 50)) as EnumerableQuery<Class122>;
            //此时真实返回的是DBquery
            //DbQuery<Class122> query = (db.Class122.Where(d => d.成绩 > 50)) as DbQuery<Class122>;
          
   
            //List<Class122> list = db.Class122.Where(d => d.成绩 > 50).ToList();
            gridControl1.DataSource = db.Class122s;
        }
    }
}
